{defun name="CatsList_spheres" list=$spheres.pages}
<ul>
{foreach from=$list item=node}
<li>
	{if $node.childs!='0'}
		<a href="#" onclick="recurseSpheres('{$node.id}','spheres_{$node.id}',{$jsCatsList_spheres});show('spheres_{$node.id}');return false;">+</a>
		<input type="checkbox" name="item[spheres][{$node.id}]" value="{$node.id}" id="sphere_{$node.id}"{if $node.selected} checked="true"{/if} /> <label for="sphere_{$node.id}">{$node.title}</label>
		<div id="spheres_{$node.id}" {if $node.inside_selected ne true}style="display:none;"{/if}>{fun name="CatsList_spheres" list=$node.sub}</div>
	{else}
		<input type="checkbox" name="item[spheres][{$node.id}]" value="{$node.id}" id="sphere_{$node.id}"{if $node.selected} checked="true"{/if} /> <label for="sphere_{$node.id}">{$node.title}</label>
	{/if}
</li>
{/foreach}
</ul>
{/defun}